package com.kkb.service.file.impl;

import com.kkb.bean.AnthologyTags;
import com.kkb.bean.FileTagsTable;
import com.kkb.dao.AnthologyTagsMapper;
import com.kkb.service.file.AnthologyTagsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Author 何世鹏
 * @Date 2021/4/16 13:43
 */
@Service
public class AnthologyTagsServiceImpl implements AnthologyTagsService {

    @Autowired
    private AnthologyTagsMapper mapper;

    /**
     * 删除关联专用删除
     *
     * @param req         请求
     * @param resp        响应
     * @param anthologyId 文集ID
     */
    @Override
    public void del(HttpServletRequest req, HttpServletResponse resp, Integer anthologyId) {
        List<AnthologyTags> select = mapper.select(new AnthologyTags(anthologyId));
        for (AnthologyTags anthologyTags : select) {
            mapper.delete(anthologyTags);
        }
    }
}
